package com.eastfair.venueservice.enumeration;

import com.eastfair.annotation.base.BaseEnum;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * <p>
 * 实体注释中生成的类型枚举
 * 结算开票记录
 * </p>
 *
 * @author linan
 * @date 2023-02-02
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "ExhibitionSettlementInvoicingCostTypeEnum", description = "费用类型 #{COST_TYPE_ONE:*会展服务*展览服务费;COST_TYPE_TWO:加班费;COST_TYPE_THREE:展具租赁费;COST_TYPE_FOUR:水、电、气使用费-枚举")
public enum ExhibitionSettlementInvoicingCostTypeEnum implements BaseEnum {

    /**
     * COST_TYPE_ONE="*会展服务*展位费"
     */
    COST_TYPE_ONE("*会展服务*展位费"),
    /**
     * COST_TYPE_TWO="*经营租赁*场地租赁"
     */
    COST_TYPE_TWO("*经营租赁*场地租赁"),
    /**
     * COST_TYPE_THREE="*会展服务*展览服务"
     */
    COST_TYPE_THREE("*会展服务*展览服务"),
    /**
     * COST_TYPE_FOUR="*会展服务*会议服务"
     */
    COST_TYPE_FOUR("*会展服务*会议服务"),
    /**
     * COST_TYPE_FIVE="*广告服务*广告宣传"
     */
    COST_TYPE_FIVE("*广告服务*广告宣传"),
    ;

    @ApiModelProperty(value = "描述")
    private String desc;


    /**
     * 根据当前枚举的name匹配
     */
    public static ExhibitionSettlementInvoicingCostTypeEnum match(String val, ExhibitionSettlementInvoicingCostTypeEnum def) {
        return Stream.of(values()).parallel().filter(item -> item.name().equalsIgnoreCase(val)).findAny().orElse(def);
    }

    public static ExhibitionSettlementInvoicingCostTypeEnum get(String val) {
        return match(val, null);
    }

    public boolean eq(ExhibitionSettlementInvoicingCostTypeEnum val) {
        return val != null && eq(val.name());
    }

    @Override
    @ApiModelProperty(value = "编码", allowableValues = "COST_TYPE_ONE,COST_TYPE_TWO,COST_TYPE_THREE,COST_TYPE_FOUR,COST_TYPE_FIVE", example = "COST_TYPE_ONE")
    public String getCode() {
        return this.name();
    }

}
